<?php
/**
 * Created by PhpStorm.
 * User: home
 * Date: 2019/2/22
 * Time: 20:50
 */
class Pet{
    public $name;
    // 宠物吼叫的方法
    public function sound(){
        echo "宠物正在叫...<br>";
    }
    // 宠物奔跑的方法
    public function run(){
        echo "宠物正在跑...<br>";
    }
}
class Cat extends Pet{
    public function sound()
    {
        parent::sound(); // 通过parent关键字可以实现调用父类方法
        echo "一起喵喵 喵喵喵!!!<br>";
    }
}
$maomao = new Cat();
$maomao->run();
$maomao->sound();